﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.IO;
using System.Data;
using System.Collections.Specialized;
using IIFProcessor;
namespace IIFService
{
    // NOTE: If you change the class name "Service1" here, you must also update the reference to "Service1" in Web.config and in the associated .svc file.
    public class ProcessorService : IProcessorService
    {
        public string GetData(int value)
        {
            return string.Format("You entered: {0}", value);
        }

        public CompositeType GetDataUsingDataContract(CompositeType composite)
        {
            if (composite.BoolValue)
            {
                composite.StringValue += "Suffix";
            }
            return composite;
        }

        //public DataTable ProcessData(string fileStreem)
        //{
        //    Processor fileProcessor = new Processor();
        //    fileProcessor.CovertFileToTable(fileStreem);
        //    return fileProcessor.TableSource;

        //}

        public StringCollection GetAccountTypes(string fileStreem)
        {
            Processor fileProcessor = new Processor();
            fileProcessor.CovertFileToTable(fileStreem);
            return fileProcessor.GetAccountTypes();

        }
        public List<string> GetCategories(string Categories)
        {
            return ExpenseCategories.GetCategories(Categories);
        }

        public DataTable ProcessData(string fileStreem, string searchText, string textMatch, string textReplacement)
        {
            Processor fileProcessor = new Processor();
            fileProcessor.ProcessData(fileStreem, searchText, textMatch, textReplacement);
            return fileProcessor.TableSource;

        }

        public DataTable ReplaceData(DataTable paypalData, string searchText, string textMatch, string textReplacement, bool isStepBy)
        {
            Processor fileProcessor = new Processor();
            return fileProcessor.ReplaceData(paypalData, searchText, textMatch, textReplacement, isStepBy);
        }

        public string GetExportDataFile(DataTable exportData)
        {
            Processor fileProcessor = new Processor();
            return fileProcessor.GetExportData(exportData);
        }
       
    }
}
